Re: Searching outlink recursively llandale - Mon Sep 28 16:15:53 EDT 2009
Gads that's a mess.
If you surround youf code with StartBrace "code" EndBrace, looks like "{-code-}" without the dashes, then your posted code will look right with indents.
[1] Forget about getting the current Object. At line 9 you set "O = current" which will change the loop control variable, and in any case may get you the module is the module which is current at the time you execute that line. If you open some other module you will be setting O to the current object in THAT module.
[2] Forget about filtering the various modules. Just loop througn all "for O in entire mod do"; if (isDeleted(O)) continue", and then look for links.
[3] At the inner-most part of you code I think you missed some braces, and you want it to look like this:
if(!null Obj)
{ for lnk in Obj -> "*" do
{ Trg1Mod = target(lnk)
if(!null Trg1Mod)
{ print Trg1Mod "\n"
}
}
}
[4] I think you need a Recursive function, not some sloppy while loop.
[5] I see you are only getting links to target modules that are already open; I think you probably want to get all modules, meaning your script will need to open them all.
Bla bla bla. I'd start again.
Run an analysis wizard to create a layout, then edit the DXL of the layout to see how it works.
|